#include <asm/asm.h>
#include <asm/regdef.h>
#include <cpu.h>
#include <asm/context.h>
#include <inst_ex_test.h>

####LEAF(n61_lh_ex_test)
    .globl n61_lh_ex_test
n61_lh_ex_test:
    .set noreorder
    li  a0, 0x3D
###test inst
    TEST_LH_EX(0xd80241b4, 0x63c6e7af, 0x80103d5c, 0x000032e9, 0x000032e8, 0xd80241b4, 0x80107045)
    TEST_LH_EX(0x5118e811, 0x3537cc30, 0x80102c20, 0x00001915, 0x00001914, 0x5118e811, 0x80104535)
    TEST_LH_EX(0xcb7ef7d5, 0x516f5fa2, 0x80100438, 0x0000db3b, 0x0000db38, 0x80110438, 0x8010df73)
    TEST_LH_EX(0x8ef75a20, 0x224cf16c, 0x801069cc, 0x00008341, 0x00008340, 0x801169cc, 0x8010ed0d)
    TEST_LH_EX(0x9554e8d4, 0x541f6c5c, 0x80101570, 0x000085e3, 0x000085e0, 0x80111570, 0x80109b53)
    TEST_LH_EX(0x2ba90e90, 0x854aa480, 0x80102ca8, 0x00002577, 0x00002574, 0x2ba90e90, 0x8010521f)
    TEST_LH_EX(0x0233e52c, 0x93252910, 0x80101348, 0x00009a19, 0x00009a18, 0x80111348, 0x8010ad61)
    TEST_LH_EX(0x892d05a4, 0x27f4cee0, 0x80102080, 0x00009091, 0x00009090, 0x80112080, 0x8010b111)
    TEST_LH_EX(0x306d25b4, 0x639e5420, 0x80103ba0, 0x00003655, 0x00003654, 0x306d25b4, 0x801071f5)
    TEST_LH_EX(0xfda5ac5c, 0xbfef7b2a, 0x80101234, 0x00005e07, 0x00005e04, 0xfda5ac5c, 0x8010703b)
    TEST_LH_EX(0x9725c3f2, 0x0a9fe408, 0x801053b4, 0x00001d5d, 0x00001d5c, 0x9725c3f2, 0x80107111)
    TEST_LH_EX(0x14c29ce0, 0xe4f821ba, 0x80108498, 0x00001bed, 0x00001bec, 0x14c29ce0, 0x8010a085)
    TEST_LH_EX(0x4afb5b60, 0x07087350, 0x80107ac8, 0x00008465, 0x00008464, 0x80117ac8, 0x8010ff2d)
    TEST_LH_EX(0x8ad28990, 0x0cf39888, 0x8010f760, 0x00000849, 0x00000848, 0x8ad28990, 0x8010ffa9)
    TEST_LH_EX(0x77d13f50, 0xd973d24c, 0x801049a8, 0x00006d0b, 0x00006d08, 0x77d13f50, 0x8010b6b3)
    TEST_LH_EX(0xd22751dc, 0xa5b9e547, 0x80100000, 0x00005e17, 0x00005e14, 0xd22751dc, 0x80105e17)
    TEST_LH_EX(0xb79a9604, 0xf7c0933a, 0x80100000, 0x0000e207, 0x0000e204, 0x80110000, 0x8010e207)
    TEST_LH_EX(0xb3d60f70, 0x8a42150e, 0x80100000, 0x00004455, 0x00004454, 0xb3d60f70, 0x80104455)
    TEST_LH_EX(0x263d267e, 0xfc91b9e0, 0x80100000, 0x0000961f, 0x0000961c, 0x80110000, 0x8010961f)
    TEST_LH_EX(0x86ffc7e4, 0x4eb2e32e, 0x80100000, 0x0000a01f, 0x0000a01c, 0x80110000, 0x8010a01f)
    TEST_LH_EX(0x0b35cb90, 0x74552053, 0x80100000, 0x0000c977, 0x0000c974, 0x80110000, 0x8010c977)
    TEST_LH_EX(0xc33fd72e, 0x8aed5147, 0x80100000, 0x00006467, 0x00006464, 0xc33fd72e, 0x80106467)
    TEST_LH_EX(0x6f805ebe, 0x4c527ee2, 0x80100000, 0x0000479b, 0x00004798, 0x6f805ebe, 0x8010479b)
    TEST_LH_EX(0xb01d9094, 0x344a6e46, 0x80100000, 0x00003655, 0x00003654, 0xb01d9094, 0x80103655)
    TEST_LH_EX(0xcb11e930, 0x04f9154e, 0x80110000, 0x00000001, 0x00000000, 0xcb11e930, 0x80110001)
    TEST_LH_EX(0xac2f2e60, 0xae49654c, 0x80110000, 0x00000003, 0x00000000, 0xac2f2e60, 0x80110003)
    TEST_LH_EX(0xa6819ff6, 0xe4035f36, 0x80110000, 0x00000003, 0x00000000, 0xa6819ff6, 0x80110003)
    TEST_LH_EX(0xc5e28b50, 0x961d3a7d, 0x80110000, 0x00000003, 0x00000000, 0xc5e28b50, 0x80110003)
    TEST_LH_EX(0x3b1d48b2, 0xc65a4620, 0x80110000, 0x00000003, 0x00000000, 0x3b1d48b2, 0x80110003)
    TEST_LH_EX(0x946ba018, 0xece22f00, 0x80110000, 0x00000001, 0x00000000, 0x946ba018, 0x80110001)
    TEST_LH_EX(0x9d87be60, 0x92f5ccd2, 0x80110000, 0x00000003, 0x00000000, 0x9d87be60, 0x80110003)
    TEST_LH_EX(0x68560824, 0xd0961508, 0x80110000, 0x00000003, 0x00000000, 0x68560824, 0x80110003)
    TEST_LH_EX(0xbab9da40, 0x33147550, 0x80110000, 0x00000001, 0x00000000, 0xbab9da40, 0x80110001)
    TEST_LH_EX(0xe1389a18, 0x4d464be0, 0x80110000, 0x00000001, 0x00000000, 0xe1389a18, 0x80110001)
    TEST_LH_EX(0xe5301277, 0x93570cb8, 0x80110000, 0x00000003, 0x00000000, 0xe5301277, 0x80110003)
    TEST_LH_EX(0x38ab6e80, 0xf012eab2, 0x80110000, 0x00000001, 0x00000000, 0x38ab6e80, 0x80110001)
    TEST_LH_EX(0x64c09a04, 0x1e0560f8, 0x80110000, 0x00000001, 0x00000000, 0x64c09a04, 0x80110001)
    TEST_LH_EX(0x1d414148, 0xb32b8718, 0x80110000, 0x00000001, 0x00000000, 0x1d414148, 0x80110001)
    TEST_LH_EX(0x88a121cc, 0x74276120, 0x80110000, 0x00000001, 0x00000000, 0x88a121cc, 0x80110001)
    TEST_LH_EX(0x5a8a321e, 0xe4e93a38, 0x80110000, 0x00000003, 0x00000000, 0x5a8a321e, 0x80110003)
    TEST_LH_EX(0x89a72091, 0xacf67b0c, 0x80110000, 0x00000001, 0x00000000, 0x89a72091, 0x80110001)
    TEST_LH_EX(0xfe02dda2, 0x1c57b520, 0x80110000, 0x00000003, 0x00000000, 0xfe02dda2, 0x80110003)
    TEST_LH_EX(0x5f886e20, 0xf28f2aed, 0x80110000, 0x00000003, 0x00000000, 0x5f886e20, 0x80110003)
    TEST_LH_EX(0xff889618, 0x403bf7e8, 0x80110000, 0x00000003, 0x00000000, 0xff889618, 0x80110003)
    TEST_LH_EX(0x879ea340, 0x4b312ac6, 0x80110000, 0x00000001, 0x00000000, 0x879ea340, 0x80110001)
    TEST_LH_EX(0x92be63b0, 0xda3fd9a8, 0x80110000, 0x00000001, 0x00000000, 0x92be63b0, 0x80110001)
    TEST_LH_EX(0xe28ebc12, 0xc421cbc8, 0x80110000, 0x00000003, 0x00000000, 0xe28ebc12, 0x80110003)
    TEST_LH_EX(0x38b10670, 0xe08ed5a0, 0x80110000, 0x00000001, 0x00000000, 0x38b10670, 0x80110001)
    TEST_LH_EX(0x0787c8b0, 0xe203991f, 0x80110000, 0x00000003, 0x00000000, 0x0787c8b0, 0x80110003)
    TEST_LH_EX(0x5e8875a8, 0xb7aa41ec, 0x80110000, 0x00000001, 0x00000000, 0x5e8875a8, 0x80110001)

###detect exception
###score ++
    addiu s3, s3, 1
###output a0|s3
inst_error:
    sw s3, 0($23)
    sw a0, 0(s1)
    jr ra
    nop
####END(n61_lh_ex_test)
